package Dao;

import java.util.HashMap;
import java.util.List;


import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import Bean.ReserBean;

public class AdminDao extends SqlMapClientDaoSupport {
	
	public List<?> admin_roomPreview() {
		return getSqlMapClientTemplate().queryForList("admin_view");
	}
	
	public List<?> YesterCount() {
		return getSqlMapClientTemplate().queryForList("YesterCount");
	}
	
	public List<?> TodayCount() {
		return getSqlMapClientTemplate().queryForList("TodayCount");
	}
	
	public List<?> WeekCount() {
		return getSqlMapClientTemplate().queryForList("WeekCount");
	}
	
	public List<?> MonthCount() {
		return getSqlMapClientTemplate().queryForList("MonthCount");
	}
	
	public List<?> Count() {
		return getSqlMapClientTemplate().queryForList("Count");
	}
	
	public Object admin_detailRoom(Integer R_NO) {
		return (Object)getSqlMapClientTemplate().queryForObject("admin_detail",R_NO);
	}
	
	public void UpdateRoomta1(HashMap<String,String> data) {
		getSqlMapClientTemplate().update("updateRoomta1",data);
	}
	public void UpdateRoomta2(HashMap<String,String> data) {
		getSqlMapClientTemplate().update("updateRoomta2",data);
	}
	
	public void InsertRoom(HashMap<String,String> data) {
		getSqlMapClientTemplate().insert("insertRoom", data);
	}
	
	//예약 리스트 보기
	public List<?> reservation() {
		return getSqlMapClientTemplate().queryForList("reser_view");
	}
	
	//예약 상세보기
	public Object getReserDetail(String re_no) {
		return (Object)getSqlMapClientTemplate().queryForObject("reser_detail",re_no);
	}
	
	//예약 수정
	public void reserUpdate(ReserBean reser){
		getSqlMapClientTemplate().update("reserUpdate", reser);
	}
	
	//예약 삭제
	public void deleteReser(int rv_no) {
		getSqlMapClientTemplate().delete("deleteReser", rv_no);
	}
	
	
	//방 삭제
	public void deleteRoom(int r_no) {
		getSqlMapClientTemplate().delete("deleteRoom", r_no);
	}
	
	//게시글 삭제
	public void deleteBoard(int nb_no) {
		getSqlMapClientTemplate().delete("deleteBoard", nb_no);
	}
	
	
	/*public List<?> D_room(Integer R_NO) {
		return getSqlMapClientTemplate().queryForList("ad_rmdetail",R_NO);
	}*/
}
